export default Vuex.createStore({
    state() {
        return {
            product: {},
            isShow: false
        }
    },
    mutations: {
        ADD_PRODUCT(state, product) {
            state.product = product
        },
        UPDATE_ISSHOW(state) {
            state.isShow = !state.isShow
        }
    },
    actions: {
        addProduct({ commit }, product) {
            commit('ADD_PRODUCT', product)
        },
        setShow({ commit }) {
            commit('UPDATE_ISSHOW')
        }
    },
    getters: {
        product: state => state.product,
        isShow: state => state.isShow
    }
})